package org.tgcloud.group.repository;

import org.apache.ibatis.annotations.Param;
import org.tgcloud.group.entity.MjBusinessAccountFollow;
import org.tgcloud.group.web.controller.dto.businessAccount.AccountCountDTO;
import org.tgcloud.group.web.controller.dto.businessAccount.BusinessAccountFollowListDTO;

import java.util.Date;
import java.util.List;

public interface MjBusinessAccountFollowMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(MjBusinessAccountFollow record);

    int insertSelective(MjBusinessAccountFollow record);

    MjBusinessAccountFollow selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(MjBusinessAccountFollow record);

    int updateByPrimaryKey(MjBusinessAccountFollow record);

    List<BusinessAccountFollowListDTO> selectManageList(@Param("startTime") Date startTime, @Param("endTime") Date endTime,
                                                        @Param("businessAccountId") Integer businessAccountId, @Param("followType") Integer followType);

    int updateStatusById(@Param("id") int id, @Param("status") short status);

    List<AccountCountDTO> selectFollowNumByTimeGroupByDepart(@Param("startTime") Date startTime, @Param("endTime") Date endTime);

    List<AccountCountDTO> selectFollowNumByTimeGroupByArea(@Param("startTime") Date startTime, @Param("endTime") Date endTime);

    MjBusinessAccountFollow selectHasAddByStartTimeAndEndTime(@Param("startTime") Date startTime, @Param("endTime") Date endTime,
                                                              @Param("businessAccountId") Integer id);
}
